<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class C_Turma extends MY_Controller {

	function __construct() {
            
            parent::__construct();
            $this->load->helper('html');
            $this->load->helper('url');
	}

        function gravarTurma(){
            
            extract($_POST);
            
            $descTurno    = array(0 => 'Matutino',1=>'Vespertino',2=>'Noturno');
            
            $turma = new models\Turma;

            $turma->setAnoLetivo($anoTurma);
            $turma->setQtdVagas($qtdVagas);
            $turma->setRegime($regular);
//            $turma->setSalaNumero('10');
            $turma->setSerieCod($serieCod);
            $turma->setTurmaCod($turmaCod);
            $turma->setTurnoCod($turnoCod);

            $this->em->persist($turma);
            
            $this->em->flush();
            
            $linhaTurma = '<tr>
              <td><input type="radio" name="chkTurma" value="'.$turma->getTurmaId().'" /></td>  
              <td width="46"><div align="center">'.$turma->getTurmaCod().'</div></td>
              <td width="128"><div align="center">'.$descTurno[$turma->getTurnoCod()].'</div></td>
            </tr>';
            
            echo TRUE.'@'.$linhaTurma;


            
        }
}